import { ref } from 'vue'
import Mediator from './mediator'

 export const useStorage = (key: string) => {
  const string = ref({} as any)
  const sub = new Mediator()
  sub.subscribe(key, function(value) {
    string.value = value
  })
  return string
}
